﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="Admin.aspx.cs" Inherits="Royaume.Admin" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<link rel="stylesheet" href="css/admin.css"/>
<script type="text/javascript" src="js/admin.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="HolderStat2" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HolderTop" runat="server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HolderMenu" runat="server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="HolderContent" runat="server">
<div class="ui-tabs ui-widget ui-widget-content ui-corner-all" style="overflow:scroll;" >
<center><h1 id="BonjourAdmin" runat="server">Bonjour </h1></center>
   <!--Section de menu gauche pour les actions disponibles-->
    <asp:Panel ID="Users" runat="server" >
        <asp:TextBox ID="txtRechercheUser" runat="server"></asp:TextBox>
        
        <asp:Button ID="btnRecherche" runat="server" Text="Rechercher" 
            onclick="btnRecherche_Click" />
        <asp:Label ID="message" runat="server" Text="(Sensible à la casse!!!)"></asp:Label>
<asp:SqlDataSource ID="dsInfoAdmin" runat="server" ConnectionString="<%$ ConnectionStrings:connDB_GAME %>"
        selectcommand="spGetInfo" SelectCommandType="StoredProcedure" UpdateCommand="spUpdateByAdmin" UpdateCommandType="StoredProcedure" >
        <UpdateParameters>
                <asp:Parameter Name="loginname" />
                <asp:Parameter Name="password" />
                <asp:Parameter Name="Race" />
                <asp:Parameter Name="alignement" />
                <asp:Parameter Name="pop" />
                <asp:Parameter Name="minerais" />
                <asp:Parameter Name="bois" />
                <asp:Parameter Name="nourriture" />
                <asp:Parameter Name="position" />
                <asp:Parameter Name="nom" />
                <asp:Parameter Name="prenom" />
                <asp:Parameter Name="age" />
                <asp:Parameter Name="Ville" />
            </UpdateParameters>
        </asp:SqlDataSource>


        <asp:GridView ID="gvListuser" runat="server" AllowPaging="true" 
            AllowSorting="true" AutoGenerateColumns="false" PageSize="5"
        DataKeyNames="pk,email,actif,nbavertissement,dateavertissement,dateretour" DataSourceID="dsInfoAdmin" 
                onselectedindexchanged="gvListuser_SelectedIndexChanged" 
            onrowupdating="gvListuser_RowUpdating" >
        <Columns>
                <asp:CommandField  ShowSelectButton="True" ShowEditButton="true" ButtonType="Button" />
                <asp:BoundField DataField="pk"  Visible="false" SortExpression="pk"/>
                <asp:BoundField DataField="loginname" HeaderText="Login" SortExpression="loginname"/>
                <asp:BoundField DataField="password" HeaderText="Password" />
                <asp:BoundField DataField="Race" ReadOnly="true" HeaderText="Race" SortExpression="Race"/>
                <asp:BoundField DataField="alignement" ReadOnly="true" HeaderText="Alignement" SortExpression="alignement" />
                <asp:BoundField DataField="pop" HeaderText="Population" SortExpression="pop"/>
                <asp:BoundField DataField="minerais" HeaderText="Minerais" SortExpression="minerais" />
                <asp:BoundField DataField="bois" HeaderText="Bois" SortExpression="bois" />
                <asp:BoundField DataField="nourriture" HeaderText="Nourriture" SortExpression="nourriture" />
                <asp:BoundField DataField="position" HeaderText="Position"  SortExpression="nourriture"/>
                <asp:BoundField DataField="nom" HeaderText="Nom"  SortExpression="nom"/>
                <asp:BoundField DataField="prenom" HeaderText="Prénom"  SortExpression="prenom"/>
                <asp:BoundField DataField="age" HeaderText="Âge"  SortExpression="age"/>
                <asp:BoundField DataField="Ville" HeaderText="Ville"  SortExpression="Ville"/>
                <asp:BoundField DataField="actif" HeaderText="actif" SortExpression="actif" />
                <asp:BoundField DataField="email" HeaderText="Email" Visible="false" />
            </Columns>
        </asp:GridView>




       <!--voir les champs-->
       
       
       <!-- AJAX %DIVINITE avertissement-->
       
        
        
           
              <asp:DropDownList ID="cboDivinite" runat="server">
              </asp:DropDownList>
             <asp:TextBox ID="txtPourcentageDivinite" runat="server" Width="25px"></asp:TextBox>%
              <asp:Button ID="btnValiderDivinite" runat="server" Text="Valider" 
                onclick="btnValiderDivinite_Click" Enabled="false" />
            
                    <!--Section pour afficher les stats  et les info sélectionner-->
    <asp:Panel ID="AfficherInfo" runat="server">
        <asp:Label ID="lblUserName" runat="server" Text="Nom du joueur"></asp:Label><hr />
        <asp:Label ID="lblInfo" runat="server" Text="Stat"></asp:Label>
        <asp:Button ID="Banir" runat="server" Text="Banir ce joueur" 
             Visible="false" onclick="Banir_Click"/>
        <asp:Button ID="Debanir" runat="server" Text="Débanir ce joueur" 
            Visible="false" onclick="Debanir_Click" />
    </asp:Panel>
      <!--FIN AJAX %DIVINITE-->


    </asp:Panel>
    </div>  
</asp:Content>
